﻿using System;
using System.ComponentModel;
using System.Linq.Expressions;

namespace WinRTFramework.Common
{
    public class Bindable : INotifyPropertyChanged
    {
        protected void NotifyPropertyChanged<T>(Expression<Func<T>> propertyExpression)
        {
            OnPropertyChanged(PropertyNameResolver.GetPropertyName(propertyExpression));
        }

        public event PropertyChangedEventHandler PropertyChanged = delegate { };
        private void OnPropertyChanged(string propertyName)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

    }
}
